<template>
  <!-- 项目的最外层 -->
  <div class="outer">
    <!-- 商品分类 -->
    <TypeNav></TypeNav>
    <!-- 列表轮播 -->
    <ListContainer></ListContainer>
    <TodayRecommend></TodayRecommend>
    <Rank></Rank>
    <Like></Like>
    <!-- 自定义属性传入子组件中 -->
    <Floor
      v-for="floor in floorList"
      :key="floor.id"
      :floor="floor"
      :cname="'swiper-container' + floor.id"
    ></Floor>
    <Brand></Brand>
  </div>
</template>

<script>
import { mapState } from "vuex";
// import TypeNav from "./type-nav";
import ListContainer from "./list-container";
import TodayRecommend from "./today-recommend";
import Rank from "./rank";
import Like from "./like";
import Floor from "./floor";
import Brand from "./brand";

export default {
  name: "HOME",
  components: {
    // TypeNav,
    ListContainer,
    TodayRecommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  computed: {
    ...mapState("home", ["floorList"]),
  },
  mounted() {
    // 发送请求获取floor的数据
    this.$store.dispatch("home/getFloorList");
  },
};
</script>

<style>
</style>